Titanium.UI.setBackgroundColor('#000');

var MainTabs = [
	{
		title: 'Latest',
		id: 'latest',
		className: 'maintab'	
	},
	{
		title: 'Top 100',
		id: 'top100',
		className: 'maintab'
	},
	{
		title: 'Bottom',
		id: 'bottom',
		className: 'maintab'
	},
	{
		title: 'Add',
		id: 'add',
		className: 'maintab'
	}
];

var MainTabGroup = Titanium.UI.createTabGroup({id:'MainTabGroup'});
var Windows = [];
for (var i=0; i < MainTabs.length; i++) {
	var el = MainTabs[i];
	Windows[el.id] = Ti.UI.createWindow({
		id: el.id + 'Window',
		url: 'main_windows/' + el.id + '.js'
	});
	var tab = Ti.UI.createTab({
		title: el.title,
		id: el.id,
		className: el.className,		
		window: Windows[el.id]
	});
	MainTabGroup.addTab(tab);
};
MainTabGroup.setActiveTab(0);
MainTabGroup.open({
	transition:Titanium.UI.iPhone.AnimationStyle.FLIP_FROM_LEFT
});